<!--
 * @Description: 插槽传参的使用
 * @Author: Zhanghan
 * @Date: 2024-11-14 20:37:40
 * @LastEditTime: 2024-12-06 08:56:38
 * @LastEditors: Zhanghan
-->
<template>
  <div>
    <div class="mb-4">插槽传参(传递方法)的使用</div>
    <Child>
      <template #list="{ list, handleClick }">
        <p
          v-for="(item, index) in list"
          :key="index"
          class="mb-1 h-9 align-middle bg-green-100"
          @click="handleClick"
        >
          {{ item }}
        </p>
      </template>
    </Child>
  </div>
</template>

<script lang="ts" setup>
import { ref } from "vue";
import Child from "./component/Child.vue";
</script>
